package io.jee.runshan.service.impl;

import io.jee.medusa.orm.DaoSupport;
import io.jee.medusa.service.impl.BaseService;
import io.jee.runshan.dao.IWeixinMenuContentDao;
import io.jee.runshan.dao.IWeixinMenuDao;
import io.jee.runshan.domain.WeixinMenu;
import io.jee.runshan.service.IWeixinMenuService;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

@Service
@Transactional
public class WeixinMenuServiceImpl extends BaseService<WeixinMenu> implements
		IWeixinMenuService {

	@Resource
	private IWeixinMenuDao menuDao;
	@Resource
	private IWeixinMenuContentDao contentDao;

	@Override
	public void delete(WeixinMenu menu) {
		contentDao.delete("menu.id", menu.getId());
		menuDao.delete(menu);
	}
	
	@Override
	public DaoSupport<WeixinMenu> getDao() {
		return menuDao;
	}

}
